home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / modules / nessus-2.2.8.mo / usr / include / nessus / includes.h < prev    next >
C/C++ Source or Header  |  2006-06-13  |  5KB  |  232 lines

  1. #ifndef ___INCLUDES_H__
  2. #define ___INCLUDES_H__
  3. /*
  4.  * Nessus system includes 
  5.  */
  6. #ifdef _CYGWIN_
  7. #undef _WIN32
  8. #endif
  9.  
  10.  
  11. #ifdef _WIN32
  12. #include "config.w32"
  13. #else
  14. #include "config.h"
  15. #endif
  16.  
  17. #ifdef HAVE_UNISTD_H
  18. #include <unistd.h>
  19. #endif /* HAVE_UNISTD_H */
  20.  
  21. #ifdef linux
  22. /* avoid symbol clash with librpcsvc.a(xmount.o) */
  23. #define xdr_fhstatus xDr_fHsTaTuS
  24. #endif
  25.  
  26. #ifdef HAVE_STDLIB_H
  27. #include <stdlib.h>
  28. #endif
  29. #ifdef HAVE_STDIO_H
  30. #include <stdio.h>
  31. #endif
  32. #if HAVE_SYS_TYPES_H
  33. #include <sys/types.h>
  34. #endif
  35. #ifdef HAVE_CTYPE_H
  36. #include <ctype.h>
  37. #endif
  38. #ifdef HAVE_ERRNO_H
  39. #include <errno.h>
  40. #endif
  41. #ifdef HAVE_FCNTL_H
  42. #include <fcntl.h>
  43. #endif
  44. #ifdef HAVE_MEMORY_H
  45. #include <memory.h>
  46. #endif
  47.  
  48. #if defined (STDC_HEADERS) && defined (HAVE_STRING_H)
  49. # include <string.h>
  50. #else                                                     
  51. # ifndef HAVE_STRCHR                                                     
  52. #  define strchr index                                                   
  53. #  define strrchr rindex                                                
  54. # endif /* not defined HAVE_STRCHR */
  55.   char *strchr (), *strrchr ();                 
  56. # ifndef HAVE_MEMCPY
  57. #  define memcpy(d, s, n) bcopy ((s), (d), (n))                      
  58. #  define memmove(d, s, n) bcopy ((s), (d), (n))                        
  59. # endif  /* not HAVE_MEMCPY */
  60. #endif  /* STDC_HEADERS && HAVE_STRING_H */
  61.  
  62. #ifdef HAVE_STRINGS_H
  63. #include <strings.h>
  64. #endif /* HAVE_STRINGS_H */
  65.  
  66.  
  67. #ifdef HAVE_LIMITS_H
  68. #include <limits.h>
  69. #endif
  70.  
  71. #ifdef HAVE_NETDB_H
  72. #include <netdb.h>
  73. #endif
  74. #ifdef HAVE_SYS_SOCKET_H
  75. #include <sys/socket.h>
  76. #endif
  77. #ifdef HAVE_NETINET_IN_SYSTM_H
  78. #include <netinet/in_systm.h>
  79. #endif
  80. #ifdef HAVE_NETINET_IN_H
  81. #include <netinet/in.h>
  82. #endif
  83. #ifdef HAVE_SYS_UN_H
  84. #include <sys/un.h>
  85. #endif
  86. #ifdef HAVE_ARPA_INET_H
  87. #include <arpa/inet.h>
  88. #endif
  89. #ifdef HAVE_SIGNAL_H
  90. #include <signal.h>
  91. #endif
  92. #ifdef HAVE_DLFCN_H
  93. #include <dlfcn.h>
  94. #endif
  95. #if HAVE_SYS_WAIT_H                                                     
  96. #include <sys/wait.h>                                                
  97. #endif                                                                
  98.  
  99. #ifndef WEXITSTATUS
  100. #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)               
  101. #endif                                                                
  102.  
  103. #ifndef WIFEXITED                                                        
  104. #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)                 
  105. #endif    
  106.  
  107. #ifdef TIME_WITH_SYS_TIME                                           
  108. # include <sys/time.h>                                                
  109. # include <time.h>                                               
  110. #else                
  111. # ifdef HAVE_SYS_TIME_H
  112. #  include <sys/time.h> 
  113. # else                                                                
  114. #  include <time.h>                                                  
  115. # endif                                                                
  116. #endif   
  117.  
  118. #ifdef HAVE_SYS_IOCTL_H
  119. #include <sys/ioctl.h>
  120. #endif
  121. #ifdef HAVE_SYS_STAT_H
  122. #include <sys/stat.h>
  123. #endif
  124. #ifdef HAVE_SYS_FILIO_H
  125. #include <sys/filio.h>
  126. #endif
  127. #ifdef HAVE_SYS_PARAM_H
  128. #include <sys/param.h>
  129. #endif
  130.  
  131. #ifdef HAVE_DIRENT_H                                                     
  132. # include <dirent.h>
  133. # define NAMLEN(dirent) strlen((dirent)->d_name)                 
  134. #else                                                                  
  135. # define dirent direct
  136. # define NAMLEN(dirent) (dirent)->d_namlen                         
  137. # ifdef HAVE_SYS_NDIR_H                                                     
  138. #  include <sys/ndir.h>                                                  
  139. # endif                                                             
  140. # ifdef HAVE_SYS_DIR_H
  141. #  include <sys/dir.h>                                                
  142. # endif                                                               
  143. # ifdef HAVE_NDIR_H                                                         
  144. #  include <ndir.h>                                         
  145. # endif            
  146. #endif   
  147.  
  148. #ifdef HAVE_SETJMP_H
  149. #include <setjmp.h>
  150. #endif
  151.  
  152. #ifdef HAVE_SSL
  153. #include <openssl/ssl.h>
  154. #include <openssl/x509.h>
  155. #endif
  156.  
  157. /*
  158.  * Threads management
  159.  *
  160.  * Nessus is currently able to deal with 
  161.  * 3 kinds of threads API :
  162.  *
  163.  * - the POSIX Threads
  164.  * - the WindowsNT Threads
  165.  * - fork() used as Threads
  166.  *
  167.  */
  168.  
  169. #ifdef NESSUSNT
  170. #define USE_NT_THREADS
  171. #else
  172. #ifndef USE_PTHREADS
  173. #define USE_FORK_THREADS
  174. #endif
  175. #endif
  176.  
  177. #ifdef USE_PTHREADS
  178. # ifdef HAVE_PTHREAD_H
  179. #  include <pthread.h>
  180. # else
  181. #  error "Your system is lacking pthread support"
  182. # endif
  183. #endif
  184.  
  185. #ifdef HAVE_SYS_MMAN_H
  186. #include <sys/mman.h>
  187. #endif
  188.  
  189.  
  190. #ifdef HAVE_LINUX_MSG_H
  191. #include <linux/msg.h>
  192. #else
  193. #ifdef HAVE_SYS_IPC_H
  194. #include <sys/ipc.h>
  195. #endif
  196. #ifdef HAVE_SYS_MSG_H
  197. #include <sys/msg.h>
  198. #endif
  199. #endif
  200.  
  201.  
  202. #ifdef HAVE_SYS_RESOURCE_H
  203. #include <sys/resource.h>
  204. #endif
  205.  
  206.  
  207. #ifdef HAVE_SYS_UIO_H
  208. #include <sys/uio.h>
  209. #endif
  210.  
  211. #ifndef MSGMAX
  212. #define MSGMAX 4000     /* This is awkwardly arbitrary */
  213. #endif
  214.  
  215. #ifdef BSD_BYTE_ORDERING
  216. # define FIX(n) (n)
  217. # define UNFIX(n) (n)
  218. #else
  219. # define FIX(n) htons(n)
  220. # define UNFIX(n) ntohs(n)
  221. #endif
  222.  
  223. #include <pcap.h>
  224.  
  225. #include <ntcompat.h>
  226. #include <libnessus.h>
  227. #include <nessus-devel.h>
  228.  
  229. #endif /* not defined(___INCLUDES_H) */
  230.  
  231.  
  232.